## read in cleaned cces data and
## output dataframes with question coding
## by year with policy domains

rm(list=ls())

library(tidyverse)

source('bootstrap_funs.R')

cces_allyears <- readRDS('cces_data/cces_allyears.RDS')

issuetopics_allyears <- cces_allyears %>% 
  select(question, year, topic_6) %>% 
  distinct()

write.csv(issuetopics_allyears, 'issuetopics_allyears.csv', row.names = FALSE)


# subset to include issues only in final year in cces

cces_subset <- cces_allyears %>% 
  subset_unique_questions()

issuetopics <- cces_subset %>% 
  select(question, year, topic_6) %>% 
  distinct()

write.csv(issuetopics, 'issuetopics.csv', row.names = FALSE)
